export class ProjectRules {
  static addRules = {
    title: [{ required: true, message: '请输入题目名称', trigger: 'blur' }],
    description: [{ required: true, message: '请输入题目描述', trigger: 'blur' }],
    requirements: [{ required: true, message: '请输入题目要求', trigger: 'blur' }],
    maxCapacity: [
      {
        required: true,
        message: '请输入题目最大人数',
        trigger: 'blur',
      },
      {
        type: 'number',
        validator: (rule: any, value: any, callback: any) => {
          if (value <=0) {
            callback(new Error('不能小于或等于0'));
          } else if (value > 10) {
            callback(new Error('不能超过10'));
          } else {
            callback();
          }
        },
        trigger: 'blur'
      }
    ],
  }
  static updateRules = {}
}
